Multiplication algorithm